#include "DShareMem.h"
#include "usart.h"
#include "stm32l4xx_hal.h"
#include "string.h"

static int __init(vfs_info *devices)
{


  return 0x01;
}
static int __exit(vfs_info *devices)
{
	
  return 0x01;
}
static int __open (vfs_info *devices, int sub_fd)
{

  return 0x01;
}
static int __close(vfs_info *devices, int sub_fd)
{

  return 0x01;
}
static int __write(vfs_info *devices, int sub_fd, void *buf, uint len)
{
  return 0x01;
}
static int __read (vfs_info *devices, int sub_fd, void *buf, uint len)
{
	
  return 0x01;
}
static int __ioctl(vfs_info *devices, int sub_fd,uint cmd , va_list ap)
{
  return 0x01;
}
static int __lseek(vfs_info *devices, int sub_fd, int  offset, int  pos)
{
  return 0x01;
}

static vfs_device_operation mem_op = {

.init = __init,
.exit = __exit,
.open = __open,
.close= __close,
.write= __write,
.read = __read,
.ioctl= __ioctl,
.lseek= __lseek,
.interrupt = NULL,
};

int  DShareMem_Driver_Init(const char * path , void *data)
{
  if (vfs_core_add(path, vfs_info_type_node) < 0x00)
    return -1;
  return vfs_core_register(path, vfs_device_type_mem, &mem_op, data, VFS_CHMOD_RD_ONLY | VFS_CHMOD_WR_ONLY, VFS_AD_ATTRIBUTE_LOCK);
}
